﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DiscoveryLogic.Common.Numeric
{
    /// <summary> Interface that represents a procedure object: a procedure that takes 
    /// a single argument and does not return a value.
    /// </summary>
    public interface DoubleProcedure
    {
        /// <summary> Applies a procedure to an argument.
        /// Optionally can return a boolean flag to inform the object calling the procedure.
        /// 
        /// <p>Example: forEach() methods often use procedure objects.
        /// To signal to a forEach() method whether iteration should continue normally or terminate (because for example a matching element has been found),
        /// a procedure can return <tt>false</tt> to indicate termination and <tt>true</tt> to indicate continuation.
        /// 
        /// </summary>
        /// <param name="element">  element passed to the procedure.
        /// </param>
        /// <returns> a flag  to inform the object calling the procedure.
        /// </returns>
        bool apply(double element);
    }
}
